<?php

class tSysUser extends CActiveRecord
{
	/**
	 * The followings are the available columns in table 'sys_user':
	 * @var integer $su_id
	 * @var string $su_email
	 * @var string $su_name
	 * @var string $su_firstname
	 * @var string $su_lastname
	 * @var string $su_cellphone
	 * @var string $su_homephone
	 * @var string $su_address
	 * @var string $su_zipcode
	 * @var string $su_ktp
	 * @var integer $id_city
	 * @var integer $su_activation
	 * @var string $su_password
	 */

	/**
	 * Returns the static model of the specified AR class.
	 * @return CActiveRecord the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'sys_user';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		return array(
			array('su_email','length','max'=>60),
			array('su_name','length','max'=>25),
			array('su_firstname','length','max'=>45),
			array('su_lastname','length','max'=>45),
			array('su_cellphone','length','max'=>15),
			array('su_homephone','length','max'=>10),
			array('su_address','length','max'=>140),
			array('su_zipcode','length','max'=>7),
			array('su_ktp','length','max'=>45),
			array('su_password','length','max'=>128),
			array('su_email, su_name, su_firstname, su_lastname, su_cellphone, su_homephone, su_address, su_zipcode, id_city, su_activation, su_password', 'required'),
			array('id_city, su_activation', 'numerical', 'integerOnly'=>true),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'su_id' => 'Su',
			'su_email' => 'Su Email',
			'su_name' => 'Su Name',
			'su_firstname' => 'Su Firstname',
			'su_lastname' => 'Su Lastname',
			'su_cellphone' => 'Su Cellphone',
			'su_homephone' => 'Su Homephone',
			'su_address' => 'Su Address',
			'su_zipcode' => 'Su Zipcode',
			'su_ktp' => 'Su Ktp',
			'id_city' => 'Id City',
			'su_activation' => 'Su Activation',
			'su_password' => 'Su Password',
		);
	}
}